Repository navigation
feat(docs): add @vercel/analytics to docs and demo site - #261
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Enables Vercel Web Analytics on
apps/docs, which hosts both the Nextra docs site and the demo site as two separate route groups inside the same Next.js app. Mounts Vercel's<Analytics />component so both route groups report page views once Web Analytics is turned on for thearm-js-library-docsVercel project.Github Issue: No tracking issue - direct request from Chael.
Changes
@vercel/analytics(^2.0.1) as a dependency inapps/docs/package.json, with the matching lockfile entries inapps/docs/yarn.lock.Analyticsfrom@vercel/analytics/nextand rendered<Analytics />inside<body>inapps/docs/app/(docs)/layout.jsx(the docs site's root layout).Analyticsfrom@vercel/analytics/nextand rendered<Analytics />inside<body>inapps/docs/app/demo/layout.jsx(the demo site's root layout) - mounted separately here because this layout does not inherit from the docs layout; each route group renders its own<html>/<body>.Screenshots/Images
No visible UI change -
<Analytics />renders no markup, it only injects a tracking script.How Has This Been Tested?
yarn buildrun locally inapps/docs: compiled all 79 pages with no errors, and thepostbuildpagefind step reindexed 56 pages successfully.Checklist
Reviewer Guidance
/). Open the browser DevTools Network tab and reload the page. Expected: a Vercel Analytics script request loads successfully (no 404/500), and the console shows no new runtime errors./demo). Repeat step 1's Network/console check on this page. Expected: same as step 1 - the demo layout mounts its own<Analytics />instance since it does not share the docs layout.arm-js-library-docsproject (Project Settings -> Analytics). This is a one-time dashboard step outside this diff.